//
//  GMPathCell.m
//  
//
//  Created by 郭明皓 on 15/10/29.
//
//

#import "GMPathCell.h"
#import "DKNightVersion.h"
#import "GMH_Share.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation GMPathCell

- (void)dealloc
{
    [_imagesView release];
    [_paths release];
    [_pathsView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}
- (void)create
{
    
    self.imagesView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.imagesView];
    [self.imagesView release];
    
    self.pathsView = [[UIView alloc]init];
    [self.contentView addSubview: self.pathsView];
    [self.pathsView release];
    self.pathsView.alpha = 0.5;
    self.pathsView.backgroundColor = [UIColor blackColor];
    self.pathsView.layer.masksToBounds = YES;
    self.pathsView.layer.cornerRadius = 10;
    
    self.paths = [[UILabel alloc]init];
    [self.contentView addSubview: self.paths];
    [self.paths release];
    self.paths.textAlignment  = NSTextAlignmentCenter;
    self.paths.textColor = [UIColor whiteColor];
    self.paths.textAlignment = NSTextAlignmentCenter;
    self.paths.font = [UIFont fontWithName:@"Helvetica-Bold" size:11];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imagesView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
    self.pathsView.frame = CGRectMake(self.contentView.center.x - WIDTH / 4, HEIGHT / 5 * 4, WIDTH / 2, WIDTH / 5);
    self.paths.frame = CGRectMake(self.contentView.center.x - WIDTH / 4, HEIGHT / 5 * 4, WIDTH / 2, WIDTH / 5);
    
}
@end
